					<style>
						.ellipsis {white-space: nowrap;overflow: hidden;}
						.ellipsis.multiline {white-space: normal;}
						.meter{ width: 90px;margin-left: -45px;height: 1px;display: inline-block;border:1px solid #cacaca;position:absolute; }
						.meter span{ display: inline-block;height: 1px;position:absolute;left:0px;}
						.meter .low{ background:red; }
						.meter .med{ background:orange; }
						.meter .hi{ background:green; }
						.td-selected{ background: #FDFFD5 !important; }
						.flags{ vertical-align: super;font-weight: bolder;font-size: 9px;color: orange; }
						.flags2{ vertical-align: super;font-weight: bolder;font-size: 9px;color: green; }
					</style>
					<div class="listing_product">
					<script type="text/javascript" src="<?php $this->path('js/checkBox.js');?>"></script>
					<script type="text/javascript" src="<?php $this->path('js/jquery.dlmenu.js');?>"></script>
        			<link href="<?php $this->path('css/ui.dialog.css');?>" rel="stylesheet" media="all" />
					<link href="<?php $this->path('css/component.css');?>" rel="stylesheet" media="all" />
					<?php if ($view == 0){ ?>
					<?php $this->showPagination( "?module=pos&action=inventory",$page, $total[0], $total[0]>$max_display?$max_display:$total[0], false); ?>
					<table id="list-item">
						<thead>
    						<tr>
    							<th width="50px"style="text-align:left;"><input class="niceCheck" type="checkbox" /></th>
    							<th class="bg">Item</th>
    							<th width="150px">Category</th>
    							<th width="100px">Unit</th>
    							<th width="150px" class="bg">Retail Price</th>
    							<th width="135px" >Wholesale Price</th>
    							<th width="200px" class="bg">Quantity</th>
    							<th width="135px">Reorder Level</th>
    						</tr>
						</thead>
						<tbody>
        						<?php if (COUNT($list) > 0) { ?>
        						<?php foreach ($list as $item) { ?>
        						<tr id="<?php echo $item['iid'] ?>" class="ease">
        							<td style="text-align:left;" class="ease">
        								<input class="niceCheck" type="checkbox" />
        								<div class="dl-menuwrapper demo-2 mini-menu" style="float: right;display: none;width: 30px;">
                            				<a class="dl-trigger ease" style="float: right;width: 15px;height: 15px;margin-right: 10px;background: #59b7c2;opacity:0.5;border-radius: 2px;"></a>
                            				<ul class="dl-menu" style="margin-left: 20px;overflow: hidden;">
    								<li style="margin-left: -50px;"><a href="#" iid="<?php echo $item['iid'] ?>" id=""  class="no-ease reorder-item">Order</a></li>
    								<li style="margin-left: -50px;"><a href="#" iid="<?php echo $item['iid'] ?>" id="" class="no-ease edit-item">Edit</a></li>
    								<li style="margin-left: -50px;"><a href="#" iid="<?php echo $item['iid'] ?>" id=""  class="no-ease del-item">Delete</a></li>
        									</ul>
        								</div>
        							</td>
        							<td class="ease bg" iname="<?php echo $item['iname'] ?>"><?php echo $item['iname'] ?>
									<?php if ($item['isnew'] < 10 && $item['isnew'] >= 0){?>
											<?php if ($item['isadded'] < 3 && $item['isadded'] >= 0){?>
										<sup class="flags2">ADDED!</sup>
											<?php }else{?>
										<sup class="flags">NEW</sup>
											<?php }?>
									<?php }?>
									</td>
        							<td class="ease"><?php echo $item['cname'] ?></td>
        							<td class="ease"><?php echo $item['uname'] ?>(<?php echo $item['per_unit'] ?>)</td>
        							<td class="ease bg">&#8369;&nbsp;<?php echo number_format($item['retail_price'], 2, '.',',&nbsp;'); ?></td>
        							<td class="ease">&#8369;&nbsp;<?php echo number_format($item['whole_sale_price'], 2, '.',',&nbsp;'); ?></td>
        							<td class="ease bg">
        								<?php echo $item['quantity'] . 'pc' . ' / ' . floor($item['quantity']/$item['per_unit']) . $item['uname']; ?>
        							</td>
        							<td class="reorder-mter" style="background:transparent !important;" qty="<?php echo $item['quantity']/$item['per_unit'];?>" rol="<?php echo $item['reorder'];?>">
        							<?php echo $item['reorder'] . $item['uname'];?>
        							</td>
        						</tr>
        						<?php } ?>
        						<?php } ?>
						</tbody>
					</table>
					</div><!-- product_li -->
					
        			<div class="clear"></div>
        			
					<script>
						$('#list-item tbody tr').hover(
							function(){
								$(this).addClass('td-selected');
								$(this).children().addClass('td-selected');
								$(this).find('.mini-menu').css('display','inline-block').find('.dl-menu').css('width','150px').find('li').css('margin-left','0px');
								var x = $(this).find('.reorder-meter');
								
								var max = (x.attr('qty') * 100 / (x.attr('rol') * 4));
    							if(max > 100)
    								max = 100;
    							if(max > 70)
    								level = "hi";
    							else if(max > 25)
    								level = "med";
    							else
    								level = "low";
  								x.hide().html('<div class="meter"><span class="ease ' + level + '" ></span></div><small style="font-size:10px;margin: 5px 0 0 0;text-align: center;margin-bottom: -5px;"><span title="Remaining Quantity">' + x.attr('qty') + '</span> / <span title="Max Quantity">' + x.attr('rol')*4 + '</span></small>').fadeIn('slow',function(){x.find('.meter span').width(max+"%")});

							},
							function(){
								$(this).removeClass('td-selected');
								$(this).children().removeClass('td-selected');
								$(this).find('.mini-menu').hide();
								var x = $(this).find('.reorder-meter');
								x.hide().html(x.attr('rol')).fadeIn('slow');
								item_menus.dlmenu("closeMenu");
							}
						);
						$('#list-item th:first-child span').click(function(){
							if( $(this).hasClass('niceChecked') )
								$(this).parent().parent().parent().parent().find('tbody tr td span.niceCheck').addClass('niceChecked');
							else
								$(this).parent().parent().parent().parent().find('tbody tr td span.niceCheck').removeClass('niceChecked');
						});
						var item_menus = $('.mini-menu').dlmenu({
            				animationClasses : { classin : 'dl-animate-in-2', classout : 'dl-animate-out-2' }
            			});
						refunc_items();
					</script>
					<?php } else { ?>
					<?php $this->showPagination( "?module=pos&action=inventory",$page, $total[0], $total[0]>$max_display?$max_display:$total[0]); ?>
					<div class="clearfix"></div>
					<br />
					<?php if (COUNT($list) > 0) { ?>
						<?php foreach ($list as $item) { ?>
					<div class="product_li" id="list-item">
						<div class="grid_3" style="width:170px;height:170px;">
							<?php if ($item['isnew'] < 10 && $item['isnew'] >= 0){?>
							<img class="sale" src="<?php $this->path('img/new.png');?>" alt="New"/>
							<?php } ?>
							<div class="prev">
								<a href="#" style="width:150px;height:150px;">
									<img style="height:inherit;width:inherit;" src="?module=photo&get=thumbnail&from=item_details&id=<?php echo $item['iid']; ?>&name=iid&ajax=true" alt="" title="" />
								</a>
							</div><!-- .prev -->
						</div><!-- .grid_3 -->
				
						<div class="grid_4" style="width:410px;height:166px;">
							<div class="entry_content">
								<h3 class="title"><a href="#"><?php echo $item['iname'] ?></a></h3>
								<div class="ellipsis multiline" style="height: 95px;"><?php echo $item['descript'] ?></div>
							</div><!-- .entry_content -->
						</div><!-- .grid_4 -->
				
    					<div class="grid_2" style="">
    						<div class="cart">
    							<div class="price" style="margin:-10px;position:absolute;" id="<?php echo $item['iid'] ?>">
    								<span class="price_old">Category:</span>
									<strong><?php echo $item['cname'] ?></strong>
									<br />
    								<span class="price_old">Retail Price:</span>
									<strong>&#8369;<?php echo number_format($item['retail_price'], 2, '.', ','); ?></strong>
									<br />
									<span class="price_old">Wholesale Price:</span>
									<strong>&#8369;<?php echo number_format($item['whole_sale_price'], 2, '.', ','); ?></strong>
									<br />
									<span class="price_old">Unit:</span>
									<strong><?php echo $item['uname'] ?>(<?php echo $item['per_unit'] ?>)</strong>
									<br />
									<span class="price_old">Quantity:</span>
									<strong><?php echo ($item['quantity']==0?0:$item['quantity'] . ' ' . $item['item_unit'] . ' / ' . floor($item['quantity']/$item['per_unit']) . ' ' . $item['uname']); ?></strong>
									<br />
    								<span class="price_old">Reorder Level:</span>
									<strong><?php echo $item['reorder']*$item['per_unit'] . ' / ' . $item['reorder'] ?></strong>
									<br />
    								<span class="price_old">Reorder Quantity:</span>
									<strong><?php echo $item['reorder2'] ?></strong>
									<br />
    								<span class="price_old">Supplier/s:</span>
									<strong><?php echo getSupplier($item['iid']); ?></strong>
    							</div>
    						</div><!-- .cart -->
    					</div><!-- .grid_2 -->
    				
						<div class="clear"></div>
					</div><!-- .article -->
					
						<?php } ?>
					<?php } ?>
					<?php } ?>
	      
					<?php $this->showPagination( "?module=pos&action=inventory",$page, $total[0], $total[0]>$max_display?$max_display:$total[0], true); ?>
					<script>
						$('.pagination2 ul li a').click(function(e){
							var type = -1;
							var src = $(this).attr('href');
							e.preventDefault();
							
							$('.grid-list a').each(function(){
								if(!$(this).hasClass('grid'))
									type++;
							});
							if(src == '#')
								return false;
							src = src.replace('page','p');
							$.post(src + '&action2=list&ajax=true', {view:view_by, display:max_display, sort_by:sort_by, sort_with:sort_with}, function(data) {
    							set_listing(data);
    						});
						});
					</script>
        			<div class="clear"></div>